티스토리 뷰
// Prevent the backspace key from navigating back.
$(document).unbind('keydown').bind('keydown', function (event) {
var doPrevent = false;
if (event.keyCode === 8) {
var d = event.srcElement || event.target;
if ((d.tagName.toUpperCase() === 'INPUT' && (d.type.toUpperCase() === 'TEXT' || d.type.toUpperCase() === 'PASSWORD' || d.type.toUpperCase() === 'FILE' || d.type.toUpperCase() === 'EMAIL' ))
|| d.tagName.toUpperCase() === 'TEXTAREA') {
doPrevent = d.readOnly || d.disabled;
}
else {
doPrevent = true;
}
}
if (doPrevent) {
event.preventDefault();
}});
뒤로가기를 백스페이스를 이용해서 이동하는걸 막을 때 유용하다.출처 : http://stackoverflow.com/questions/1495219/how-can-i-prevent-the-backspace-key-from-navigating-back
'공부합시다' 카테고리의 다른 글
focusout (0) | 2014.08.06 |
---|---|
MYSQL EXPLAIN ? (0) | 2014.07.28 |
자바스크립트 버전넣기 (0) | 2014.06.12 |
유튜브 동영상 z-index 문제 (0) | 2014.06.09 |
드래그 & 드롭 사이트 (0) | 2014.04.30 |
댓글
- Total
- Today
- Yesterday
TAG
- 정의
- laravel-test
- MySQL
- 나는욕심쟁이
- php-laravel
- 메일
- graphql
- Python
- eloquant
- php
- exception-test
- addMonth
- Laravel
- 자바스크립트
- 라라벨
- session+token authorize
- django
- 둘이상인증한번에사용하기
- VIM-COMMAND
- composer-self-update
- 정규식
- composite-primarykey
- 테스트_다중트랜잭션
- graphql-php
- POP3
- composer-install
- addMonthWithoutOverflow
- vim
- redis
- php-composer
공지사항